#!/usr/bin/python
# -*- coding:utf-8 -*-
# @FileName : test5_4.py
# Author    : myh

# 练习 5.8：以特殊方式跟管理员打招呼　创建一个至少包含 5 个用户名
# 的列表，并且其中一个用户名为 'admin'。想象你要编写代码，在每
# 个用户登录网站后都打印一条问候消息。遍历用户名列表，向每个用
# 户打印一条问候消息。



user_name_table =['admin','admin1','admin2','admin3','admin4']


# 练习 5.9：处理没有用户的情形　在为练习 5.8 编写的程序中，添加一
# 条 if 语句，检查用户名列表是否为空。
# user_name_table =[]
print(len(user_name_table))
if len(user_name_table)<=0:  # user_name_table==[]
    print("We need to find some users!")
else:
    user_name = input('请输入用户名 (Please input user name):')
    if user_name in user_name_table:
        if user_name == 'admin':
            print("Hello admin, would you like to see a status report?")
        elif user_name == 'admin1':
            print("Hello admin1, would you like to see a status report?")
        elif user_name == 'admin2':
            print("Hello admin2, would you like to see a status report?")
        elif user_name == 'admin3':
            print("Hello admin3, would you like to see a status report?")
        else:
            print("Hello admin4, would you like to see a status report?")
    else:
        print("Hello %s, thank you for logging in again." % user_name)




